﻿Public Class ven_pol1

    

    
    Private Sub btnok_ven_pol1_Click(sender As Object, e As EventArgs) Handles btnok_ven_pol1.Click
        
        yc1 = Convert.ToSingle(txtyc1_jp1.Text)
        fp11 = Convert.ToSingle(txt_fp11.Text)
        fp21 = Convert.ToSingle(txt_fp21.Text)
        dp11 = Convert.ToSingle(txt_dp11.Text)
        dp21 = Convert.ToSingle(txt_dp21.Text)
        tetap1 = Convert.ToSingle(txt_tetap1.Text)
        decp1 = Convert.ToSingle(txt_decp1.Text)

        tetap1 = tetap1 * (3.141592 / 180)
        alfap1 = Math.Asin((dp21 - dp11) / (2 * decp1))

        fxcp1 = -Math.Cos(alfap1) * (fp11 + fp21)
        fzcp1 = Math.Sin(alfap1) * (fp11 - fp21)

        fxp1 = fxcp1 * Math.Cos(tetap1) - fzcp1 * Math.Sin(tetap1)
        fzp1 = fxcp1 * Math.Sin(tetap1) + fzcp1 * Math.Cos(tetap1)

        c1x = fxp1
        c1y = 0
        c1z = fzp1
        m1x = 0
        m1y = -(fp11 + fp21) * dp11 * 0.5
        m1z = 0

        Me.Close()

    End Sub
End Class